<form id="dialog-add-content" name="authorizeForm" novalidate style="width:1000px;">
    <div class="col-sm-8 clearfix">
        <div class="table-header mt5" style="position: relative; margin-bottom: 10px;">
            <div class="clearfix" style="padding-bottom:4px;">
                <span class="fl f14 lh30 text-indent">激活授权</span>
            </div>
        </div>
        <ul class="authorize-list mt10">
            <li>
                <div class="authorize-title">授权</div>
                <div class="authorize-chart" id="js_authorize_total"></div>
            </li>
        </ul>
        <ul class="authorize-list mt10">
            <li>
                <div class="authorize-title">绑定</div>
                <div class="authorize-chart" id="js_authorize_used"></div>
            </li>
        </ul>
        <ul class="authorize-list mt10">
            <li>
                <div class="authorize-title">可用</div>
                <div class="authorize-chart" id="js_authorize_usable"></div>
            </li>
        </ul>
    </div>
    <div class="col-sm-16">
        <div class="table-header mt5" style="position: relative; margin-bottom: 10px;">
            <div class="clearfix">
                <span class="fl f14 lh30 text-indent">授权列表</span>

                <div class="fr btn-group">
                    <a href="javascript:;" class="btn btn-yellow"
                       ui-dialog="新增"
                       ui-dialog-show="onShowCreateContract(data,$dialog,$dialogScope)"
                       ui-dialog-cache="false"
                       ui-dialog-ok="createContract($data,$dialog,$dialogScope)"
                       ui-dialog-url="/tenant/dialog/contract.html">
                        <i class="btn-icon-add"></i>新增
                    </a>
                </div>
            </div>
        </div>
        <div style="height:475px;overflow: auto;">
            <div class="table-wrap" ng-class="{'mt10':!$first}" ng-repeat="item in data.contracts">
                <table width="100%">
                    <thead>
                    <tr class="thead ta-l">
                        <th height="34" colspan="3">
                            <span style="margin-right:10px;">{{item.ContractNum}}</span><span>{{item.PartyA}}</span>
                        </th>
                        <th height="34" width="140" class="operate-btn">
                            <div ng-if="item.Status==1">
                                <a href="javascript:void(0)" title="编辑" class="mr15"
                                   ui-dialog="编辑授权"
                                   ui-dialog-data="item"
                                   ui-dialog-cache="false"
                                   ui-dialog-ok="editContract($data,$dialog,$dialogScope)"
                                   ui-dialog-url="/tenant/dialog/contract.html">
                                    <i class="icon-op icon-op-edit">&nbsp;</i>
                                    <span>编辑</span>
                                </a>
                                <a href="javascript:void(0)" title="作废" ng-click="setAside(item)" class="mr15">
                                    <i class="icon-op icon-op-del">&nbsp;</i>
                                    <span>作废</span>
                                </a>
                            </div>
                        </th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="packageItem in item.packages">
                        <td height="60">{{packageItem.friendly_name}}</td>
                        <td>授权：{{packageItem.total_num}}</td>
                        <td>绑定：{{packageItem.used_num}}</td>
                        <td>可用：{{packageItem.total_num-packageItem.used_num}}</td>
                    </tr>
                    <tr>
                        <td height="40" colspan="4">
                            <span class="c-gray">租期：{{item.BeginOn?item.BeginOn.split(' ')[0]:''}} 至 {{item.EndOn?item.EndOn.split(' ')[0]:''}}</span>
                            <span ng-class="{'label-yellow':item.Status==1,'label-gray':item.Status==2 || item.Status==3}">{{item.Status==1?'激活':(item.Status==3?'过期':'作废')}}</span>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</form>